package com.hyperfix.simulator.controller;

import com.hyperfix.simulator.service.impl.SysJobService;
import com.hyperfix.models.common.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author JiangChunYu
 * 2024/3/14
 */
@RestController
@RequestMapping("/sysJob")
public class SysJobController {
    @Resource
    private SysJobService sysJobService;

    @PostMapping("/changeStatus/{pipelineId}/{stop}")
    public R<String> changeStatus(@PathVariable("pipelineId") Integer pipelineId, @PathVariable("stop") Integer stop) {
        return sysJobService.changeStatus(pipelineId, stop);
    }

    @PostMapping("/changeCycle/{pipelineId}/{period}")
    public R<String> changeCycle(@PathVariable("pipelineId") Integer pipelineId,
                                 @PathVariable("period") Long period) {
        return sysJobService.changeCycle(pipelineId, period);
    }
}
